﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/Administration.Master"
    AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="mal.balades.Web.Administration.Feeds.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table border="1">
        <thead>
            <tr>
                <td>
                    Nom
                </td>
                <td>
                    Url
                </td>
                <td>
                    Latitude
                </td>
                <td>
                    Longitude
                </td>
                <td>&nbsp;</td>
            </tr>
        </thead>
        <tbody data-bind="template: {name:'feedsTemplate', foreach:feeds}">
        </tbody>
         <tfoot>
            <tr>
                <td>
                    <input type="text" data-bind="value: feedName"   />
                </td>
                <td>
                     <input type="url"   data-bind="value: feedUrl"/>
                </td>
                <td>
                     <input type="number"  data-bind="value: feedLatitude" />
                </td>
                <td>
                    <input type="number" data-bind="value: feedLongitude" />
                </td>
                <td>
                   <button data-bind="click: addFeed" >Ajouter</button>
                    <button data-bind="click: resetFeed" >Annuler</button>
                </td>
            </tr>
        </tfoot>       
    </table>
   
   <button data-bind="click: saveFeeds" >Enregistrer</button>

   <style>
    .isDirty
    {
    	background-color:Orange;
    }
    
    .isDeleted
    {
    	background-color:red;
    }
    
   </style>
    <script id="feedsTemplate" type="text/html">    
<tr data-bind="css: { isDeleted: IsDeleted(), isDirty:IsDirty() }">
    <td>
        <input data-bind="value: Name" />
    </td>  
    <td>
       <input data-bind="value: Url" />
   </td>
    <td>
        <input data-bind="value: Latitude" />
    </td>  
    <td>
       <input data-bind="value: Longitude" />
   </td>
   <td>
    <button data-bind="click: deleteFeed" >Supprimer</button>
     <button data-bind="click: cancel" >Annuler</button>
   </td>
</tr>    
    </script>
   
</asp:Content>
